package com.wuze.cloud.dao;

import com.wuze.cloud.pojo.SysFolderDO;
import com.wuze.cloud.request.SysFolderQuery;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Set;

/**
 * @author: wuze
 * @description:
 * @date: 2023/02/16
 */
@Repository
public interface SysFolderDao {

    //=========读接口=============
    SysFolderDO findOne(@Param("query") SysFolderQuery query);

    SysFolderDO findByName(@Param("query") SysFolderQuery query,@Param("state") String state);

    SysFolderDO findById(@Param("id") Long id);

    List<SysFolderDO> findByIds(@Param("ids") Set<Long> ids);
    List<SysFolderDO> findList(@Param("userId")Long userId,@Param("state") String state);

    List<SysFolderDO> findByPid(@Param("pid")Long pid,@Param("state") String state);




    //==========写接口=============
    void save(@Param("folderDO") SysFolderDO folderDO);

    void update(@Param("folderDO") SysFolderDO folderDO);

    void batchUpdateFolderState(@Param("ids")List<Long> ids,@Param("state") String state);

    void batchRestoreOrDel(@Param("ids")List<Long> ids,
                           @Param("rootId") Long rootId,
                           @Param("uuid") String uuid);
}
